package com.qn.visitor.write;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@Component
public class WriteContext {
    @Autowired
    WriteProperties properties;
    @Autowired
    ApplicationContext applicationContext;

    public IpAddressrWrite getIpAddressrWriteInstanc() {
        String name = properties.getWriteType() + IpAddressrWrite.class.getSimpleName();
        IpAddressrWrite writeService=
                applicationContext.getBean(name, IpAddressrWrite.class);
        return writeService;
    }
    public UserAgentWrite getUserAgentWriteInstanc() {
        String name = properties.getWriteType() + UserAgentWrite.class.getSimpleName();
        UserAgentWrite writeService=
                applicationContext.getBean(name, UserAgentWrite.class);
        return writeService;
    }
    public UserLanguageWrite getsUerLanguageWriteInstanc() {
        String name = properties.getWriteType() + UserLanguageWrite.class.getSimpleName();
        UserLanguageWrite writeService=
                applicationContext.getBean(name, UserLanguageWrite.class);
        return writeService;
    }
    public VisitorWrite getVisitorWriteInstanc() {
        String name = properties.getWriteType() + VisitorWrite.class.getSimpleName();
        VisitorWrite writeService=
                applicationContext.getBean(name, VisitorWrite.class);
        return writeService;
    }
    public VisitorEventWrite getVisitorEventWriteInstanc() {
        String name = properties.getWriteType() + VisitorEventWrite.class.getSimpleName();
        VisitorEventWrite writeService=
                applicationContext.getBean(name, VisitorEventWrite.class);
        return writeService;
    }
}
